<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	
	<display-name>UserRegister</display-name>
	<description>UserRegister用户注册程序</description>
	
	<!-- 定义Spring配置文件位置 -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:applicationContext*.xml</param-value>
	</context-param>
	
	<!-- 编码处理过滤器 -->
	<filter>
		<filter-name>encodingFilter</filter-name>
		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>utf-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	
	<!-- 验证码图片生成 -->
	<!--  
	<filter>
		<filter-name>jCaptchaFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
		<init-param>
			<param-name>targetFilterLifecycle</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	-->
	<!-- 管理员登录验证码校验 -->
	<!-- 
	<filter>
		<filter-name>adminLoginJCaptchaFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
		<init-param>
			<param-name>targetFilterLifecycle</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	 -->
	
	<!-- Spring Security过滤器 -->
	<!-- 
	<filter>
		<filter-name>springSecurityFilterChain</filter-name>   
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	 -->
	
	<!-- 页面缓存过滤器 -->
	
	<!-- 
	<filter>
		<filter-name>cacheFilter</filter-name>
		<filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
		<init-param>
			<param-name>time</param-name>
			<param-value>3600</param-value>
		</init-param>
		<init-param>
			<param-name>scope</param-name>
			<param-value>application</param-value>
		</init-param>
	</filter>
	 -->
	
	<!-- 解决Hibernate延迟加载问题过滤器，需放在struts2过滤器之前 -->
	<filter>
		<filter-name>openSessionInViewFilter</filter-name>
		<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
		<init-param>
			<param-name>excludeSuffixs</param-name>
			<param-value>js,css,jpg,gif,png,bmp,jpeg</param-value>
		</init-param>
	</filter>
	
	<!-- Struts2过滤器 -->
	<filter>
		<filter-name>struts</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
	</filter>
	
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
	<!-- 验证码图片 -->
	
	<!-- 
	<filter-mapping>
		<filter-name>jCaptchaFilter</filter-name>
		<url-pattern>/captcha.jpg</url-pattern>
	</filter-mapping>
 -->
	<!-- 后台登录验证码表单处理URL.必须放在springSecurityFilter的filter-mapping之前 -->
	<!-- 
	<filter-mapping>
		<filter-name>adminLoginJCaptchaFilter</filter-name>
		<url-pattern>/admin/loginVerify</url-pattern>
	</filter-mapping>
	
	 -->
	 
	 <!-- 
	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/admin/*</url-pattern>
	</filter-mapping>
	
	 -->
	
	<!-- 商品列表页面缓存 -->
	<!-- 
	<filter-mapping>
		<filter-name>cacheFilter</filter-name>
		<url-pattern>/shop/product!list.action</url-pattern>
	</filter-mapping>
	 -->
	
	<!-- 文章列表页面缓存 -->
	<!-- 
	<filter-mapping>
		<filter-name>cacheFilter</filter-name>
		<url-pattern>/shop/article!list.action</url-pattern>
	</filter-mapping>
	 -->
	
	<!-- 注意:需放在struts2过滤器filter-mapping之前 -->
	<filter-mapping>
		<filter-name>openSessionInViewFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>struts</filter-name>
		<url-pattern>*.action</url-pattern>
	</filter-mapping>
	
	<!-- JSPSupportServlet配置 -->
	<servlet>
		<servlet-name>JSPSupportServlet</servlet-name>
		<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	
	<!-- 对Spring容器进行实例化 -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	
	<!-- Spring刷新Introspector防止内存泄露 -->
	<listener>
		<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
	</listener>
	
	<!-- Session超时定义,单位为分钟 -->
	<session-config>
		<session-timeout>60</session-timeout>
	</session-config>

	<!-- 定义默认访问页 -->
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>index.action</welcome-file>
	</welcome-file-list>
	
	<!-- 出错页面定义 -->
	<error-page>
		<exception-type>java.lang.Throwable</exception-type>
		<location>/html/error_page.html</location>
	</error-page>
		<error-page>
		<error-code>500</error-code>
		<location>/html/error_page_500.html</location>
	</error-page>
	<error-page>
		<error-code>404</error-code>
		<location>/html/error_page_404.html</location>
	</error-page>
	<error-page>
		<error-code>403</error-code>
		<location>/html/error_page_403.html</location>
	</error-page>

</web-app>